package pojo.users;

import Mysqlcon.Conn;
import dao.Registerdao;
import pojo.users.User;

import java.sql.PreparedStatement;

public class Register extends Conn {

	public static void tologin () throws Exception{
		System.out.println("******欢迎注册******");
		Registerdao logindao =new Registerdao();
		User user=logindao.getinfo();

		String sql = "insert into user(username,userpassword,email,tel,updatetime,org) values(?,?,?,?,NOW(),'syx')";
		PreparedStatement ps = connection.prepareStatement(sql);
		ps.setString(1, user.getUsername());
		ps.setString(2, user.getPassword());
		ps.setString(3, user.getEmail());
		ps.setString(4, user.getTel());


		int i = ps.executeUpdate();
		if (i != -1) {
			System.out.println("注册成功!");
		} else {
			System.out.println("注册成功!");
		}


	}
}
